package com.wxproject.demo.Service.impl;

import com.wxproject.demo.Entity.AO.ArticleTypeAO;
import com.wxproject.demo.Entity.AO.ArticleTypeAlterAO;
import com.wxproject.demo.Entity.VO.ArticleTypeIndexVO;
import com.wxproject.demo.Entity.VO.ArticleTypeVO;
import com.wxproject.demo.Mapper.ArticleTypeMapper;
import com.wxproject.demo.Service.ArticleTypeService;
import com.wxproject.demo.Utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zqf
 * @date 2021/4/9 20:40
 * @description
 */
@Service
public class ArticleTypeServiceImpl implements ArticleTypeService {
    @Autowired
    private ArticleTypeMapper articleTypeMapper;

    @Override
    public Integer addArticleType(ArticleTypeAO articleTypeAO) {
        return articleTypeMapper.addArticleType(articleTypeAO);
    }

    @Override
    public Integer addChatRoom(String chatRoomId, String typeName,String articleId,String date) {
        return articleTypeMapper.addChatRoom(chatRoomId,typeName,articleId,date);
    }

    @Override
    public List<ArticleTypeVO> getAllArticleType() {
        return articleTypeMapper.getAllArticleType();
    }

    @Override
    public Integer alertType(ArticleTypeAlterAO articleTypeAlterAO) {
        return articleTypeMapper.alertType(articleTypeAlterAO);
    }

    @Override
    public Integer deleteType(String id) {
        return articleTypeMapper.deleteType(id,DateUtils.getDate());
    }

    @Override
    public Integer deleteRoom(String id) {
        return articleTypeMapper.deleteRoom(id);
    }

    @Override
    public List<ArticleTypeIndexVO> getTypeList() {
        return articleTypeMapper.getTypeList();
    }
}
